using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._3DAnalystTools._3DFeatures._Extraction
{
    /// <summary>
    /// <para>Extract Power Lines From Point Cloud</para>
    /// <para>Extracts 3D line features modeling power lines 
    /// from classified point cloud data.</para>
    /// <para>提取 3D 线路特征，对电源线进行建模
    /// 来自分类的点云数据。</para>
    /// </summary>    
    [DisplayName("Extract Power Lines From Point Cloud")]
    public class ExtractPowerLinesFromPointCloud : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ExtractPowerLinesFromPointCloud()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_point_cloud">
        /// <para>Input Point Cloud</para>
        /// <para>The LAS dataset layer containing points classified as power lines.</para>
        /// <para>包含分类为电力线的点的 LAS 数据集图层。</para>
        /// </param>
        /// <param name="_class_codes">
        /// <para>Power Line Class Codes</para>
        /// <para>The class code values for the points representing the power lines.</para>
        /// <para>表示电力线的点的类代码值。</para>
        /// </param>
        /// <param name="_out_3d_lines">
        /// <para>Output 3D Lines</para>
        /// <para>The 3D lines modeling the power lines.</para>
        /// <para>对电力线进行建模的 3D 线路。</para>
        /// </param>
        public ExtractPowerLinesFromPointCloud(object _in_point_cloud, List<object> _class_codes, object _out_3d_lines)
        {
            this._in_point_cloud = _in_point_cloud;
            this._class_codes = _class_codes;
            this._out_3d_lines = _out_3d_lines;
        }
        public override string ToolboxName => "3D Analyst Tools";

        public override string ToolName => "Extract Power Lines From Point Cloud";

        public override string CallName => "3d.ExtractPowerLinesFromPointCloud";

        public override List<string> AcceptEnvironments => ["XYResolution", "XYTolerance", "ZResolution", "ZTolerance", "extent", "geographicTransformations", "outputCoordinateSystem", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_point_cloud, _class_codes, _out_3d_lines, _point_tolerance, _separation_distance, _max_sampling_gap, _line_tolerance, _wind_correction.GetGPValue(), _min_wind_span, _max_wind_deviation, _end_point_search_radius, _min_length];

        /// <summary>
        /// <para>Input Point Cloud</para>
        /// <para>The LAS dataset layer containing points classified as power lines.</para>
        /// <para>包含分类为电力线的点的 LAS 数据集图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Point Cloud")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_point_cloud { get; set; }


        /// <summary>
        /// <para>Power Line Class Codes</para>
        /// <para>The class code values for the points representing the power lines.</para>
        /// <para>表示电力线的点的类代码值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Power Line Class Codes")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _class_codes { get; set; }


        /// <summary>
        /// <para>Output 3D Lines</para>
        /// <para>The 3D lines modeling the power lines.</para>
        /// <para>对电力线进行建模的 3D 线路。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output 3D Lines")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_3d_lines { get; set; }


        /// <summary>
        /// <para>Point Tolerance</para>
        /// <para>The distance used to establish the points that belong to a given power line. The default is 80 centimeters.</para>
        /// <para>用于建立属于给定电源线的点的距离。默认值为 80 厘米。</para>
        /// <para>单位： Meters | Decimeters | Centimeters | Yards | Feet | Inches </para>
        /// </summary>
        [DisplayName("Point Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _point_tolerance { get; set; } = "80 Centimeters";


        /// <summary>
        /// <para>Wire Separation Distance</para>
        /// <para>The distance points must be to determine if they belong to different power lines. The default is 1 meter.</para>
        /// <para>距离点必须用于确定它们是否属于不同的电源线。默认值为 1 米。</para>
        /// <para>单位： Meters | Decimeters | Centimeters | Yards | Feet | Inches </para>
        /// </summary>
        [DisplayName("Wire Separation Distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _separation_distance { get; set; } = "1 Meters";


        /// <summary>
        /// <para>Maximum Wire Sampling Gap</para>
        /// <para>The largest gap that can exist in a given span of a power line. The catenary curve being modeled from a set of power line points will be extended by this distance to find other points that fit the same power line. The default is 5 meters.</para>
        /// <para>在给定的电力线跨度中可能存在的最大间隙。从一组电力线点建模的悬链线曲线将延长此距离，以找到适合同一电力线的其他点。默认值为 5 米。</para>
        /// <para>单位： Meters | Decimeters | Centimeters | Yards | Feet | Inches </para>
        /// </summary>
        [DisplayName("Maximum Wire Sampling Gap")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _max_sampling_gap { get; set; } = "5 Meters";


        /// <summary>
        /// <para>Output Line Tolerance</para>
        /// <para>The distance used to establish the accuracy of the output power line. A larger distance will result in the creation of less vertices per line, yielding a more coarse representation of the power line when compared with a smaller distance. The default is 1 centimeter.</para>
        /// <para>用于确定输出电源线精度的距离。与较小的距离相比，较大的距离将导致每条线创建的顶点更少，从而产生更粗略的电力线表示。默认值为 1 厘米。</para>
        /// <para>单位： Meters | Decimeters | Centimeters | Yards | Feet | Inches </para>
        /// </summary>
        [DisplayName("Output Line Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _line_tolerance { get; set; } = "1 Centimeters";


        /// <summary>
        /// <para>Adjust for wind distortion</para>
        /// <para><xdoc>
        ///   <para>Specifies whether wind correction will be used to improve how points fit a given power line. Wind correction will only be applied in one direction and only for power lines with spans that are longer than the distance specified in the Minimum Span for Wind Correction parameter.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Wind correction will be used to improve the catenary curve's fitting of points belonging to the same power line. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Wind correction will not be used, resulting in the creation of power lines that may not fit the points captured in the point cloud survey.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否使用风校正来改进点与给定电源线的拟合方式。风校正将仅在一个方向上应用，并且仅适用于跨度大于风校正最小跨度参数中指定的距离的电力线。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 风校正将用于改进接触网曲线对属于同一电力线的点的拟合。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将不使用风校正，从而导致创建的电力线可能与点云调查中捕获的点不拟合。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Adjust for wind distortion")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _wind_correction_value _wind_correction { get; set; } = _wind_correction_value._true;

        public enum _wind_correction_value
        {
            /// <summary>
            /// <para>WIND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("WIND")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_WIND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_WIND")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Minimum Span for Wind Correction</para>
        /// <para>The shortest distance a power line span can be to apply wind correction when generating the output power line. The default is 60 meters.</para>
        /// <para>电力线跨度的最短距离是在生成输出电力线时应用风校正。默认值为 60 米。</para>
        /// <para>单位： Meters | Decimeters | Centimeters | Yards | Feet | Inches </para>
        /// </summary>
        [DisplayName("Minimum Span for Wind Correction")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _min_wind_span { get; set; } = "60 Meters";


        /// <summary>
        /// <para>Maximum Deviation Angle</para>
        /// <para>The maximum angle that the wind is expected to deviate a given power line. The default is 10°.</para>
        /// <para>预计风偏离给定电力线的最大角度。默认值为 10°。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Deviation Angle")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _max_wind_deviation { get; set; } = 10;


        /// <summary>
        /// <para>End Point Search Radius</para>
        /// <para>The distance used to identify a common suspension point for power line segments connected to the same distribution pole or transmission tower. The default is 10 meters.</para>
        /// <para>用于识别连接到同一配电杆或输电塔的电力线段的公共悬挂点的距离。默认值为 10 米。</para>
        /// <para>单位： Meters | Decimeters | Centimeters | Yards | Feet | Inches </para>
        /// </summary>
        [DisplayName("End Point Search Radius")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _end_point_search_radius { get; set; } = "10 Meters";


        /// <summary>
        /// <para>Minimum Wire Length</para>
        /// <para>The shortest wire length that can be used to determine the presence of a common end point. The default is 5 meters.</para>
        /// <para>可用于确定是否存在公共端点的最短导线长度。默认值为 5 米。</para>
        /// <para>单位： Meters | Decimeters | Centimeters | Yards | Feet | Inches </para>
        /// </summary>
        [DisplayName("Minimum Wire Length")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _min_length { get; set; } = "5 Meters";


        public ExtractPowerLinesFromPointCloud SetEnv(object XYResolution = null, object XYTolerance = null, object ZResolution = null, object ZTolerance = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(XYResolution: XYResolution, XYTolerance: XYTolerance, ZResolution: ZResolution, ZTolerance: ZTolerance, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}